<script setup>
import { ElMenu, ElMenuItem } from 'element-plus';
</script>

<template>
  <el-container>
    <el-header class="fixed-header">
      <div class="logo-container">
        <img src="/public/images/主页/u128.png">
        <router-link to="/index" style="color: black"><h2>双碳招投标网</h2></router-link>
      </div>
      <div class="menu-container">
        <el-menu class="custom-menu">
          <el-menu-item>
            <router-link to="/ptdt">平台动态</router-link>
          </el-menu-item>
          <el-menu-item>
            <router-link to="/zcfg">政策法规</router-link>
          </el-menu-item>
          <el-menu-item>
            <router-link to="/wgts">违规投诉</router-link>
          </el-menu-item>
        </el-menu>
      </div>
      <div class="person-container">
        <img src="/public/images/主页/u122.png">
        <router-link to="/grzx" style="text-decoration: none;color: black"><span>admin</span></router-link>
      </div>
    </el-header>
    <div class="header-placeholder"></div>
  </el-container>
</template>

<style scoped>
/* 固定头部样式 */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background-color: #ffffff;
  height: 70px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-placeholder {
  height: 70px;
}

/* logo 容器 */
.logo-container {
  display: flex;
  align-items: center;
  width: 200px;
}

.logo-container img {
  height: 40px;
}

.logo-container h2 {
  padding-left: 8px;
  margin: 0;
  white-space: nowrap;
}

/* 菜单容器 */
.menu-container {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* 自定义菜单样式 */
.custom-menu {
  border-right: none !important;
  display: flex !important;
  background-color: transparent !important;
  border-bottom: none !important;
}

.custom-menu .el-menu-item {
  color: #000000;
  font-size: 16px;
  padding: 0 20px;
  height: 70px;
  line-height: 70px;
  border-bottom: none !important;
  list-style: none !important;  
  padding-left: 20px !important; 
}

.custom-menu .el-menu-item a {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
  height: 100%;
}

.custom-menu .el-menu-item:hover {
  background-color: #f5f7fa;
}

/* 个人中心容器 */
.person-container {
  display: flex;
  align-items: center;
  width: 200px;
  justify-content: flex-end;
}

.person-container img {
  height: 40px;
  margin-right: 8px;
}

.person-container span {
  white-space: nowrap;
}
</style>